<h2>{$langs.HEADING_EDIT_EMAILTEMPLATE}</h2>
<br />
{include file="$_TEMPLATE_SOURCE_DIR/modules/validate_error.tpl" }
<div>
<form action="{$link_edit_emailtemplate}" method="post" name="frmEdit" >
	<input type="hidden"  name="action" value="process" />
 	<table width="100%" cellpadding="2" cellspacing="2" >	
		<tr>
		  <td width="120">{$langs.TEXT_EMAILTEMPLATE_KEY}</td>
		  <td><input name="emailtemplate_key" type="text" id="emailtemplate_key" value="{$emailtemplate_key}" size="50"></td>
	  </tr>
		<tr>
		  <td>{$langs.TEXT_EMAILTEMPLATE_STATUS}</td>
		  <td>{html_radios name="emailtemplate_status" options=$status_options selected=$emailtemplate_status separator="<br /><br />"}</td>
	  </tr>    
	<tr>
		  <td>{$langs.TEXT_EMAILTEMPLATE_IS_HTML_EMAIL}</td>
		  <td>{html_radios name="is_html_email" options=$yesno_status_options selected=$is_html_email separator="<br /><br />"}</td>
	  </tr>    	  
	  <tr><td colspan="2">
	  	<ul id="infotabs" class="shadetabs">
		{section name=languageidx loop=$languages}	
			<li><a href="#" rel="language{$languages[languageidx].id}" {if languageudx==0} class="selected" {/if} ><img src="{dev_get_image_source name=$languages[languageidx].image}"  alt="{$languages[languageidx].name}" border="0"/></a></li>
		{/section}		
	</ul>
	
	  	<div style="border: 1px solid green; padding: 10px; width: 100%; margin-bottom: 1em;">
		{section name=languageidx loop=$languages}	
		{assign var="langid" value=$languages[languageidx].id}
		<div style="display: none;" id="language{$langid}" class="tabcontent">
		  <table width="100%" border="0"  cellpadding="2" cellspacing="5">
		     <tr><td class="main"  width="120">{$langs.TEXT_EMAILTEMPLATE_TITLE}*</td>
				<td><input name="emailtemplates_title[{$langid}]" type="text" value="{$emailtemplates_title[$langid]}" size="30"  /></td>
			</tr>
		     <tr><td class="main"  width="120">{$langs.TEXT_EMAILTEMPLATE_SUBJECT}*</td>
				<td><input name="emailtemplates_subject[{$langid}]" type="text" value="{$emailtemplates_subject[$langid]}" size="100"  /></td>
			</tr>

			<tr><td class="main">{$langs.TEXT_EMAILTEMPLATE_CONTENT}</td>
				<td><textarea name="emailtemplates_content[{$langid}]" cols="50" rows="15" id="emailtemplates_content[{$langid}]"  class="tinymce" >{$emailtemplates_content[$langid]}</textarea></td>
			</tr>
			<tr><td class="main">{$langs.TEXT_EMAILTEMPLATE_USAGE}</td>
				<td><textarea name="emailtemplates_usage[{$langid}]" cols="80" rows="5" id="emailtemplates_usage[{$langid}]"  >{$emailtemplates_usage[$langid]}</textarea></td>
			</tr>
		</table>
		</div>
		{/section}
		</div>
	  </td></tr>
	  		
		<tr>
		  <td>&nbsp;</td>
		  <td>
		    <input type="submit" name="Submit" value="{$BUTTON_SUBMIT}" class="button">
	        <input type="button" name="btnCancel" value="{$BUTTON_CANCEL}" onClick="window.location	='{$back_link}';" class="button">
		  </td>
	  </tr>
	</table>
</form>	
</div>

{literal}
<script type="text/javascript">
var infos=new ddtabcontent("infotabs")
	infos.setpersist(true)
	infos.setselectedClassTarget("link") //"link" or "linkparent"
	infos.init()
</script>
{/literal}